Digital video streams may represent video using a sequence of frames or still images. Digital video can be used for various applications including, for example, video conferencing, high definition video entertainment, video advertisements, or sharing of user-generated videos. A digital video stream can contain a large amount of data and consume a significant amount of computing or communication resources of a computing device for processing, transmission, or storage of the video data. Various approaches have been proposed to reduce the amount of data in video streams, including compression and other encoding techniques.
Encoding can be based on motion estimation and/or spatial similarities and may be performed by breaking frames or images into blocks that are predicted. Predicting a block based on motion estimation can be performed based on one or more prediction blocks of reference frames. Predicting a block based on spatial similarities can be performed based on other blocks within the same frame or image. Differences (i.e., residual errors) between blocks and prediction blocks are compressed and encoded in a bitstream. A decoder uses the differences to reconstruct the frames or images.